import {request} from "@/utils/request";
// 水电信息列表
export const getWaterElectricityListApi = (data) => {
    return request({
        url: '/ht-smart-house/lifeServiceManage/getWaterElectricityList',
        method: 'POST',
        data
    })
}
// 水电缴费记录
export const getWaterElectricityLogApi = (data) => {
    return request({
        url: '/ht-smart-house/lifeServiceManage/getWaterElectricityLog',
        method: 'POST',
        data
    })
}
// 水电充值
export const waterElectricityRechargeApi = (data) => {
    return request({
        url: '/ht-smart-house/lifeServiceManage/waterElectricityRecharge',
        method: 'POST',
        data
    })
}
// 意见反馈
export const addFeedbackMessageApi = (text) => {
    return request({
        url: '/ht-smart-house/lifeServiceManage/addFeedbackMessage',
        method: 'POST',
        data:{
            feedback:text
        }
    })
}
export const getLeaseOrderListApi = params => {
    return request({
        url: `/ht-smart-house/facilitiesManage/getLeaseOrderInfo`,
        method: 'POST',
        data: params
    })
}
/**
 * 获取支付数据
 * @param data {Object}
 * @returns {Promise | Promise<unknown>}
 */
export const userPayLeaseOrderApi = data => {
    return request({
        url: `/ht-smart-house/facilitiesManage/userPayLeaseOrder`,
        method: 'POST',
        data:[data]
    })
}
/**
 * 获取对公转账支付
 * @param data {Object}
 * @returns {Promise | Promise<unknown>}
 */
export const userLeaseOrderPublicTransferApi = data => {
    return request({
        url: `/ht-smart-house/facilitiesManage/userLeaseOrderPublicTransfer`,
        method: 'POST',
        data:[data]
    })
}
/**
 * 取消支付
 * @param data {Object}
 * @returns {Promise | Promise<unknown>}
 */
export const userCancelPayLeaseOrderApi = data => {
    return request({
        url: `/ht-smart-house/facilitiesManage/userCancelPayLeaseOrder`,
        method: 'POST',
        data:{
            orderIds:[data]
        } 
    })
}
export const userCancelPayApi = id => {
    return request({
        url: `/ht-smart-house/uploadFile/userCancelPay?id=${id}`,
        method: 'GET'
    })
}
/**
 * 获取用户订单详情
 * @param id {String}
 * @returns {Promise | Promise<unknown>}
 */
export const getOrderDetailApi = id => {
    return request({
        url: `/ht-smart-house/facilitiesManage/getLeaseOrderInfo`,
        method: 'POST',
        data: {
            page:1,
            size:1,
            orderId:id,
        }
    })
}
/**
 * 用量列表
 * @param data {Object}
 * @returns {Promise | Promise<unknown>}
 */
export const getWaterElectricityLogDayApi = data => {
    return request({
        url: `/ht-smart-house/lifeServiceManage/getWaterElectricityLogDay`,
        method: 'POST',
        data
    })
}